package com.wx.app.spacewhisper.mapper;


import com.wx.app.spacewhisper.entity.Whisper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;



@Repository
@Mapper
public interface WhisperMapper {

    /**
     * 发布吐槽
     * @param content 吐槽内容
     * @param timeStamp 发布时间
     * @param state 0不敏感 1敏感
     * @return 返回一个整数
     */
    @Insert("insert into whisper(content,time,state)value(#{content},#{timeStamp},#{state})")
    int insertWhisper(String content, Long timeStamp, Integer state);

    /**
     * 查找吐槽
     * @param id 吐槽id
     * @return 返回
     */
    @Select("select *from whisper where id=#{id}")
    Whisper selectWhisper(Integer id);

}

